﻿
Namespace WPF
    <ValueConversion(GetType(Boolean), GetType(Visibility))> Public Class NotBooleanToVisibilityConverter
        Implements IValueConverter

#Region " Methods "

        Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert

            Try

                If CType(value, Boolean) Then
                    Return Visibility.Collapsed

                Else
                    Return Visibility.Visible
                End If

            Catch ex As Exception
                Return Visibility.Collapsed
            End Try

        End Function

        Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
            Throw New NotImplementedException
        End Function

#End Region

    End Class

End Namespace
